%{
#include <stdio.h>
%}

%%

integer			printf("TOKENINTEGER\n");
boolean			printf("TOKENBOOLEAN\n");
array			printf("TOKENARRAY\n");
real			printf("TOKENREAL\n"); 
label			printf("TOKENLABEL\n"); 

program		    	printf("TOKENPROGRAM\n");
declare			printf("TOKENDECLARE\n");
begin			printf("TOKENBEGIN\n");
end			printf("TOKENEND\n");
of			printf("TOKENOFF\n");
procedure 		printf("TOKENPROCEDURE\n");
if			printf("TOKENIF\n");
then			printf("TOKENTHEN\n");
else			printf("TOKENELSE\n");
do			printf("TOKENDO\n");
while			printf("TOKENWHILE\n");
read			printf("TOKENREAD\n");
write			printf("TOKENWRITE\n");
goto			printf("TOKENGOTO\n");
return			printf("TOKENRETURN\n");
not			printf("TOKENNOT\n");
false			printf("TOKENFALSE\n");
true			printf("TOKENTRUE\n");
or			printf("TOKENOR\n");
and			printf("TOKEAND\n");
-			printf("TOKENMINUS\n");
=			printf("TOKENEQUALS\n");
[>]			printf("TOKENGREATER\n");
[>][=]			printf("TOKENGREATEREQ\n");
[!][=]			printf("TOKENDIFF\n");
[+]			printf("TOKENSUM\n");
[*]			printf("TOKENTIMES\n");
[/]			printf("TOKENDIV\n");
mod			printf("TOKENMOD\n");
[:][=]			printf("TOKENATTRIB\n");


['] 			printf("SIMPLEASPAS\n");
,			printf("COLON\n");
:			printf("DOUBLE DOTS\n");
;			printf("SEMICOLON\n");
[(]			printf("OPENPAR\n");
[)]			printf("CLOSEPAR\n");
[[]			printf("OPENSQUARE\n");
[]]			printf("CLOSESQUARE\n");


[a-zA-Z]					printf("LETTER\t %s\n",yytext);
[a-zA-Z][a-zA-Z0-9]*  				 printf("IDENTIFIER\t %s\n",yytext);
[0-9]						printf("DIGIT\t %s\n", yytext);
[0-9]*						printf("INTEGER\t %s\n", yytext);
[a-zA-Z0-9$%_@#!"':;?\|}{()~]			printf("CHARARACTER\t %s\n",yytext);

\n                      /* ignora \n */;
[ \t]+                  /* ignora espaço */;
%%

int yywrap(){
	return 1;
}
